/**
 * 
 */
package com.lehecai.core.lottery;

import com.lehecai.core.IntegerBeanLabelItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * @author qatang
 * 竞彩冠亚军状态
 */
public class JcgyjRaceStatus extends IntegerBeanLabelItem {

	private static final Logger logger = LoggerFactory.getLogger(JcgyjRaceStatus.class.getName());
    private static final long serialVersionUID = -698984100188832745L;

    private static List<JcgyjRaceStatus> items = new ArrayList<JcgyjRaceStatus>();
	private static List<JcgyjRaceStatus> queryItems = new ArrayList<JcgyjRaceStatus>();

	protected JcgyjRaceStatus(String name, int value, boolean queryOnly) {
		super(JcgyjRaceStatus.class.getName(), name, value);

		queryItems.add(this);
		if (!queryOnly) {
			items.add(this);
		}
	}
	protected JcgyjRaceStatus(String name, int value) {
		this(name, value, false);
	}
	
	public static JcgyjRaceStatus getItem(int value){
		try {
			return (JcgyjRaceStatus) JcgyjRaceStatus.getResult(JcgyjRaceStatus.class.getName(), value);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return null;
		}
	}
	
	public static List<JcgyjRaceStatus> getItems() {
		return items;
	}
	public static List<JcgyjRaceStatus> getItemsForQuery() {
		return queryItems;
	}
	
	public static final JcgyjRaceStatus ALL = new JcgyjRaceStatus("全部", -1, true);
	public static final JcgyjRaceStatus UNOPEN = new JcgyjRaceStatus("未开启", 1);
	public static final JcgyjRaceStatus OPEN = new JcgyjRaceStatus("已开启", 2);
	public static final JcgyjRaceStatus CLOSE = new JcgyjRaceStatus("关闭", 3);
	public static final JcgyjRaceStatus DRAW = new JcgyjRaceStatus("已开奖", 4);
	public static final JcgyjRaceStatus REWARD = new JcgyjRaceStatus("已派奖", 5);
	public static final JcgyjRaceStatus RESULT_SET = new JcgyjRaceStatus("结果已公布", 6);
}
